<?php
$this->breadcrumbs=array(
    'Warehouse' => array('#'),
    'Inventory' => array('#'),
	'Master Data' => array('#'),
    'Item Sub Categories' => array('index'),
        //'Informasi Relasi SKP Terhadap SOP'=>array('#'),
);
?>
<div class="col-xs-10">
	<div class="page-content">
		<div class="page-header">
			<?php
            Yii::app()->clientScript->registerScript('search', "
            $('.search-button').click(function(){
                $('.search-form').slideToggle('fast');
                return false;
            });
            $('.search-form form').submit(function(){
                $.fn.yiiGridView.update('item-subcategories-grid', {
                    data: $(this).serialize()
                });
                return false;
            });
            ");
            
            ?>
            
            
            <?php 
            $this->beginWidget('zii.widgets.CPortlet', array(
                'htmlOptions'=>array(
                    'class'=>''
                )
            ));
            $this->widget('bootstrap.widgets.TbMenu', array(
                'type'=>'pills',
                'items'=>array(
                    array('label'=>'Create', 'icon'=>'icon-plus', 'url'=>Yii::app()->controller->createUrl('create'), 'linkOptions'=>array()),
                            array('label'=>'List', 'icon'=>'icon-th-list', 'url'=>Yii::app()->controller->createUrl('index'),'active'=>true, 'linkOptions'=>array()),
                    array('label'=>'Search', 'icon'=>'icon-search', 'url'=>'#', 'linkOptions'=>array('class'=>'search-button')),
            
                ),
            ));
            $this->endWidget();
            ?>
            
            
            
            <div class="search-form" style="display:none">
            <?php $this->renderPartial('_search',array(
                'model'=>$model,
            )); ?>
            </div><!-- search-form -->
            
            
            <?php $this->widget('bootstrap.widgets.TbGridView',array(
                'id'=>'item-subcategories-grid',
                'dataProvider'=>$model->search(),
                    'type'=>'striped bordered condensed',
                    'template'=>'{summary}{items}{pager}',
                'columns'=>array(
                    'name',
                    'code',
                    'description',
                    'desc_category' => array(
                                'value' => '$data->desc_category->name',
                                'header' => 'Category',
                                'headerHtmlOptions' => array(
                                    'width' => '60px',
                                ),
                                'htmlOptions' => array(
                                    'valign' => 'top',
                                    'align' => 'left',
                                ),
                            ),
                   array(
                        'class'=>'bootstrap.widgets.TbButtonColumn',
                        'template' => '{view} {update} {delete}',
                        'buttons' => array(
                              'view' => array(
                                'label'=> 'View',
                                'options'=>array(
                                    'class'=>'btn btn-small view'
                                )
                            ),	
                                          'update' => array(
                                'label'=> 'Update',
                                'options'=>array(
                                    'class'=>'btn btn-small update'
                                )
                            ),
                            'delete' => array(
                                'label'=> 'Delete',
                                'options'=>array(
                                    'class'=>'btn btn-small delete'
                                )
                            )
                        ),
                        'htmlOptions'=>array('style'=>'width: 115px'),
                       )
                ),
            )); ?>

 		 </div> <!-- end div page-header -->
	</div> <!-- end div page-content -->
</div> <!-- end div col-xs-12 -->
